package com.itheima.controller;

import com.itheima.interceptors.WebServletRequestListener;
import com.itheima.pojo.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SomeController {
    @RequestMapping("/request/count")
    public String getRequestCount() {
        return "当前请求数: " + WebServletRequestListener.requestCount;
    }

    @RequestMapping("/request/demo")
    public String demo() {
        try {
            Thread.sleep(10000);
        }catch (Exception e){
            e.printStackTrace();
        }
        return Result.success().toString();
    }
}
